package org.dwell.vertx3.demos.consumer;

import io.vertx.core.Context;
import io.vertx.core.Future;
import io.vertx.core.Verticle;
import io.vertx.core.Vertx;

/**
 * Created by JianGuo on 2016/1/18.
 */
public class Launcher implements Verticle {

    private Vertx vertx;

    @Override
    public Vertx getVertx() {
        return this.vertx;
    }

    @Override
    public void init(Vertx vertx, Context context) {
        this.vertx = vertx;
    }

    @Override
    public void start(Future<Void> voidFuture) throws Exception {
        vertx.deployVerticle(new ConsumerVerticle());
        vertx.deployVerticle(new ProviderVerticle());

    }

    @Override
    public void stop(Future<Void> voidFuture) throws Exception {

    }

    public static void main(String[] args) {
        Vertx vertx = Vertx.vertx();
        vertx.deployVerticle(new Launcher());
    }
}
